package com.unipay.statistics.controller;

import com.unipay.common.result.Result;
import com.unipay.order.client.OrderFeignClient;
import com.unipay.vo.order.OrderCountQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Project: yitong_parent
 * @Author: Chenmy
 * @Time: 2023-07-27 20:54:32
 * @Desc: TODO
 */
@Api("统计管理接口")
@RestController
@RequestMapping("/unipay/statistics")
public class StatisticsController {

    @Autowired
    private OrderFeignClient orderFeignClient;

    @ApiOperation(value = "获取：订单统计数据")
    @PostMapping("getCountMap")
    public Result getCountMap(
        // @ApiParam(name = "orderCountQueryVo", value = "订单统计查询对象", required = false)
        @RequestBody OrderCountQueryVo orderCountQueryVo
    ){
        System.out.println("init().............");
        Map<String, Object> countMap = orderFeignClient.getCountMap(orderCountQueryVo);
        return Result.ok(countMap);
    }

    @ApiOperation(value = "接口测试")
    @GetMapping("test")
    public Result test(){
        System.out.println("test...........");
        return Result.ok("test...........");
    }
}
